package com.meeruu.sg.account.core.domain.component.thread;

/**
 * @Auther: liwu
 * @Date: 2019/5/6 13:55
 * @Description:
 */
public enum ThreadEnum {

    ONE("ONE", "单个守护线程"),
    FIXED("FIXED", "固定守护线程"),
    MANUAL("MANUAL", "手动设置参数"),
    MAN2REJ("MAN2REJ", "手动附带拒绝策略");


    private String value;
    private String remark;

    ThreadEnum(String value, String remark) {
        this.value = value;
        this.remark = remark;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    public static ThreadEnum getByValue(String value){

        for(ThreadEnum thread:values()){
            if (thread.value.equalsIgnoreCase(value)){
                return thread;
            }
        }
        throw new IllegalArgumentException("不支持的类型" + value);
    }
}
